from rest_framework.routers import DefaultRouter
from .views import AuthViewSet
from django.urls import path, include
from . import views
from .views import AddressListCreateView, AddressDetailView

router = DefaultRouter()
router.register(r'', AuthViewSet, basename='auth')  # 注册用户认证视图集

urlpatterns = [
    path('', include(router.urls)),  # 将 router.urls 合并到 urlpatterns
    # 地址列表 & 创建
    path('addresses/', AddressListCreateView.as_view(), name='address-list'),
    # 地址详情 & 修改 & 删除
    path('addresses/<int:id>/', AddressDetailView.as_view(), name='address-detail'),
]


